from typing import TypeVar

from sqlalchemy.orm import Mapped, mapped_column, relationship

from recruit.adapter.database.models.base import AbstractResume

Resume = TypeVar('Resume')


class ResumeInfo(AbstractResume):
    """ Model ResumeInfo. """
    name: Mapped[str] = mapped_column(comment='Имя')
    patronymic: Mapped[str] = mapped_column(comment='Отчество')
    surname: Mapped[str] = mapped_column(comment='Фамилия')
    residence: Mapped[str] = mapped_column(
        nullable=True,
        comment='Место проживания'
    )
    resume: Mapped['Resume'] = relationship(
        back_populates='resume_info',
        lazy='selectin'
    )
